package com.mes.schedule.manager.iface.ScheduleOperation;

import java.util.Date;
import java.util.List;

import org.jdom2.Element;

import com.mes.common.exception.bo.BaseBusinessException;
import com.mes.common.manager.iface.IBasicManager;
import com.mes.common.util.Page;
import com.mes.schedule.domain.SOperationTask;
import com.mes.schedule.domain.SPartTask;
import com.mes.schedule.domain.ScheduleEvent;
import com.mes.schedule.domain.ScheduleOperationRecord;
import com.mes.schedule.domain.ScheduleScheme;

/**
 * <p>
 * 调度事件管理
 * </p>
 * Created on Mar 11, 2008
 * @author lhy
 * 
 */
public interface IOperationCombineBatchManager  extends IBasicManager {

	/**
	 * 按照事件sourceuid来决定是新增或者更改事件，避免同类事件重复发送
	 * @param masterShopUid 产生事件的部门
	 * @param scheduleEvent
	 * @throws BaseBusinessException
	 */
	public void SaveOrUpdateBySource(String masterShopUid,ScheduleEvent scheduleEvent)throws BaseBusinessException ;

	
	/**
	 * 按照事件sourceuid来决定是新增或者更改事件，避免同类事件重复发送
	 * @param masterShopUid 产生事件的部门
	 * @param scheduleEvent
	 * @throws BaseBusinessException
	 * @throws Exception 
	 */
	public void addScheduleEvent(String masterShopUid,ScheduleEvent scheduleEvent)throws BaseBusinessException, Exception ;	
	
	
	public void writeOperLog(ScheduleScheme scheme,String eventType, Element operElement) throws Exception;


	/**
	 * 获取事件的主参数 by hba
	 * @param scheduleEvent
	 * @param eventPara
	 * @param scheme
	 * @return
	 * @throws Exception 
	 */
	public String getEventPara(ScheduleEvent scheduleEvent, String eventPara,
			ScheduleScheme scheme) throws Exception;
	
	/**
	 * 获取事件的子参数 by hba
	 * @param scheduleEvent
	 * @param eventPara
	 * @param scheme
	 * @return
	 */
	public List<String> getEventChildPara(ScheduleEvent scheduleEvent, String eventPara,
			ScheduleScheme scheme)throws Exception;

	public List<ScheduleOperationRecord> findScheduleEventsByConditions(
			ScheduleScheme scheme, String keyUid,Date fromDate, Date toDate,
			Integer eventState, String eventType, String eventObject, String drawingId, String batchNum, Page page)throws Exception;


	public void createCombineBatchInfo(List<SPartTask> updatedPartList,
			List<SOperationTask> CombinedOperationsList) throws Exception;

}
